<template>
    <el-container style="height: 100%">
        <el-aside width="200px" style="background-color: #424242">
            <el-menu :collapse="isCollapse" :default-active="defMenu"
                     style="height: 100%;user-select: none" background-color="#424242"
                     text-color="#fff" active-text-color="#ffd04b">
                <div class="top">
                    <span>管理员</span>
                    <el-button type="text" @click="loginOut">退出</el-button>
                </div>
                <el-menu-item index="list" @click="$router.push('/list')">
                    <label style="cursor: pointer">
                        <i class="el-icon-user"/>
                        <span slot="title">人员管理</span>
                    </label>

                </el-menu-item>
                <el-menu-item index="community" @click="$router.push('/community')">
                    <label style="cursor: pointer">
                        <i class="el-icon-location"/>
                        <span slot="title">小区管理</span>
                    </label>
                </el-menu-item>
                <el-menu-item index="adv_admin" @click="$router.push('/adv_admin')">
                    <label style="cursor: pointer">
                        <i class="el-icon-location"/>
                        <span slot="title">旅游报名管理</span>
                    </label>
                </el-menu-item>
            </el-menu>
        </el-aside>
        <el-main>
            <router-view/>
        </el-main>
    </el-container>
</template>
<script>
    export default {
        data() {
            return {
                isCollapse: false,
                defMenu: 'list'
            }
        },
        mounted() {
            this.defMenu=this.$route.name
        },
        methods: {
            loginOut() {
                this.$router.push('/login')
            }
        }
    }
</script>
<style lang="scss" scoped>
    .top {
        padding: 40px 20px;
        span {
            color: white;
            font-size: 20px;
            padding-right: 20px;
        }
    }
</style>
